package cn.stylefeng.guns.modular.storage.mapper;

import cn.stylefeng.guns.base.pojo.page.LayuiPageInfo;
import cn.stylefeng.guns.modular.storage.entity.Kfgoods;
import cn.stylefeng.guns.modular.storage.entity.StorageStock;
import cn.stylefeng.guns.modular.storage.model.params.StorageStockParam;
import cn.stylefeng.guns.modular.storage.model.result.StorageStockResult;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 库存表 Mapper 接口
 * </p>
 *
 * @author zhucx
 * @since 2019-07-25
 */
public interface StorageStockMapper extends BaseMapper<StorageStock> {

    /**
     * 获取列表
     *
     * @author zhucx
     * @Date 2019-07-25
     */
    List<StorageStockResult> customList(@Param("paramCondition") StorageStockParam paramCondition);


    /**
     * 获取列表
     *
     * @author zhucx
     * @Date 2019-07-25
     */
    List<StorageStockResult> findListBySpec(@Param("paramCondition") StorageStockParam paramCondition,@Param("operateId")Long operateId);

    List<StorageStockResult> findExportToExcelBySpec(@Param("paramCondition") StorageStockParam paramCondition,@Param("operateId")Long operateId);

    /**
     * 获取map列表
     *
     * @author zhucx
     * @Date 2019-07-25
     */
    List<Map<String, Object>> customMapList(@Param("paramCondition") StorageStockParam paramCondition);

    /**
     * 获取分页实体列表
     *
     * @author zhucx
     * @Date 2019-07-25
     */
    Page<StorageStockResult> customPageList(@Param("page") Page page, @Param("paramCondition") StorageStockParam paramCondition, @Param("condition") String condition);

    /**
     * 获取分页map列表
     *
     * @author zhucx
     * @Date 2019-07-25
     */
    Page<Map<String, Object>> customPageMapList(@Param("page") Page page, @Param("paramCondition") StorageStockParam paramCondition);

	boolean batchAddList(@Param("ssPlist")List<StorageStockParam> ssPlist);

    List<StorageStockResult> finByOnlyOne(@Param("paramCondition") StorageStockParam sp);

    boolean updateBatchList(@Param("splist")List<StorageStock> splist);

	List<StorageStockResult> findListByparamList(@Param("ssrlist")List<StorageStockParam> ssrlist);

	StorageStockResult findTotalBySpec(@Param("paramCondition")StorageStockParam storageStockParam,@Param("operateId")Long operateId);

	StorageStockResult findTotalBySpec2(@Param("paramCondition")StorageStockParam storageStockParam);

	List<StorageStockResult> findGoodsProportion(@Param("paramCondition")StorageStockParam storageStockParam);

	StorageStockResult findTotalgoodsTypeBySpec(@Param("paramCondition")StorageStockParam storageStockParam,@Param("operateId")Long operateId);

	Page<StorageStockResult> findGoodsListBySpec(@Param("page") Page page,@Param("paramCondition")StorageStockParam storageStockParam);

    List<StorageStockResult> findGoodsList(@Param("paramCondition")StorageStockParam storageStockParam,@Param("operateId")Long operateId);

    StorageStockResult findByTrayId(@Param("paramCondition")StorageStockParam storageStockParam);

    StorageStockResult findByTrayIdall(@Param("paramCondition")StorageStockParam storageStockParam);

    List<StorageStockResult> findTrayList(@Param("paramCondition")StorageStockParam storageStockParam);

    List<StorageStockResult> totalGoodsVolumeList(@Param("paramCondition")StorageStockParam storageStockParam,@Param("operateId")Long operateId);

    StorageStockResult findFixedTotal(@Param("paramCondition")StorageStockParam storageStockParam);

	StorageStockResult findSumBySpec(@Param("paramCondition")StorageStockParam param);

	Page<StorageStockResult> findPageGroupByGoodsIdBySpec(@Param("page") Page page, @Param("paramCondition")StorageStockParam param, @Param("diskId")Long diskId, @Param("condition")String condition);

	Page<StorageStockResult> findPageDetailedBySpec(@Param("page")Page pageContext, @Param("paramCondition")StorageStockParam param);

	StorageStockResult findBySpec(@Param("paramCondition")StorageStockParam param);

    StorageStockResult  findById(@Param("paramCondition")Integer id);

	StorageStockResult findTotalBySpecms(@Param("paramCondition")StorageStockParam storageStockParam,@Param("operateId")Long operateId);

	Page<StorageStockResult> findGoodsListBySpecms(@Param("page")Page pageContext, @Param("paramCondition")StorageStockParam storageStockParam);

    List<StorageStockResult> moveQueryGoods(@Param("paramCondition")StorageStockParam param,@Param("operateId")Long operateId);

	List<StorageStockResult> findDetailedBySpec(@Param("paramCondition")StorageStockParam param);


	Page<StorageStockResult> findStockPageBySpec(@Param("page")Page pageContext, @Param("paramCondition")StorageStockParam storageStockParam
			, @Param("startPutTime")String startPutTime, @Param("endPutTime")String endPutTime
			, @Param("startSingleTime")String startSingleTime, @Param("endSinglePutTime")String endSinglePutTime
			, @Param("operateId")Long operateId);

    StorageStockResult findByGoods(@Param("paramCondition")StorageStockParam stockParam,@Param("operateId")Long operateId);

    List<StorageStockResult> checkPositionGoodsNum(@Param("paramCondition")StorageStockParam param);

	int findTrayListRecommend(@Param("paramCondition")StorageStockParam param);


	List<StorageStockResult> findListBySpecandssss(@Param("paramCondition")StorageStockParam param);


	StorageStockResult sumbysqzkk(@Param("paramCondition")StorageStockParam param);


	List<StorageStockResult> moveDiskFindGoodsList(@Param("paramCondition")StorageStockParam param,@Param("operateId")Long operateId);


	List<StorageStockResult> findGoodsProportionNew(@Param("paramCondition")StorageStockParam param,@Param("operateId")Long operateId);


	List<StorageStockResult> findGoodsListBySpecNew(@Param("paramCondition")StorageStockParam param,@Param("operateId")Long operateId);


	List<StorageStockResult> findGoodsListBySpecmsNew(@Param("paramCondition")StorageStockParam param,@Param("operateId")Long operateId);


	List<StorageStockResult> moveQueryGoodsNEW(@Param("paramCondition")StorageStockParam param);


	List<StorageStockResult> sumGoods(@Param("paramCondition")StorageStockParam param);


	StorageStockResult sumGoodsZongliang(@Param("paramCondition")StorageStockParam param);


	Integer baozhiqiCount(@Param("paramCondition")StorageStockParam param);


	Integer baozhiqi2Count(@Param("paramCondition")StorageStockParam param);


	Integer baozhiqi1Count(@Param("paramCondition")StorageStockParam param);


	Integer baozhiqiGuoqiCount(@Param("paramCondition")StorageStockParam param);


	Page<StorageStockResult> findStockPageBySpecGoods(@Param("page")Page pageContext, @Param("paramCondition")StorageStockParam storageStockParam, @Param("operateId")Long operateId);

	Page<StorageStockResult> findStockPageBySpecProducetime(@Param("page")Page pageContext, @Param("paramCondition")StorageStockParam storageStockParam, @Param("operateId")Long operateId);
	
	List<StorageStockResult> findshishikucun(@Param("paramCondition")StorageStockParam storageStockParam,@Param("currentDate")String currentDate,@Param("operateId")Long operateId);


	List<Kfgoods> findkfgoods(@Param("paramCondition")StorageStockParam storageStockParam);


	List<StorageStockResult> findListBySpec2(@Param("paramCondition")StorageStockParam storageStockParam,@Param("operateId")Long operateId);


	StorageStockResult findBySpec2(@Param("paramCondition")StorageStockParam sparam3);

	StorageStockResult findDongzuoByPositionId(@Param("paramCondition")StorageStockParam storageStockParam);


	List<StorageStockResult> findPanDianPositionListBySpec(@Param("paramCondition")StorageStockParam storageStockParam
			, @Param("userId")Long userId,@Param("diskId")Long diskId);


	StorageStockResult findPanDianPositionBySpec(@Param("paramCondition")StorageStockParam storageStockParam
			, @Param("userId")Long userId, @Param("diskId")Long diskId);


	List<StorageStockResult> findPanDianTrayListBySpec(@Param("paramCondition")StorageStockParam storageStockParam
			, @Param("userId")Long userId, @Param("diskId")Long diskId);


	List<StorageStockResult> findPanDianGoodsListBySpec(@Param("paramCondition")StorageStockParam storageStockParam
			, @Param("userId")Long userId, @Param("diskId")Long diskId);


	List<StorageStockResult> moveDiskFindGoodsListChoupan(@Param("paramCondition")StorageStockParam storageStockParam, @Param("diskId")Long diskId,@Param("operateId")Long operateId);


	List<StorageStockResult> findListBySpecDongzuo(@Param("paramCondition")StorageStockParam ssp, @Param("operateId")Long operateId);


	Page<StorageStockResult> findStockPageBySpecGoodsChuzhi(@Param("page")Page pageContext, @Param("paramCondition")StorageStockParam storageStockParam, @Param("operateId")Long operateId);


	List<StorageStockResult> findListGroupgoodsbatchs(@Param("paramCondition")StorageStockParam sp);


	List<StorageStockResult> findListSumBySpec(@Param("paramCondition")StorageStockParam sp);


	Integer addReturnId(@Param("paramCondition")StorageStockParam param);


	List<StorageStockResult> finByOnlyOnePositionNumber(@Param("paramCondition")StorageStockParam sp);


	List<StorageStockResult> finByOnlyOneOrderByGoodsbatchs(@Param("paramCondition")StorageStockParam sp);


	void deleteBySpec(@Param("paramCondition")StorageStockParam param);


	Page<StorageStockResult> findStockPageBySpecPositionNumber(@Param("page")Page pageContext, @Param("paramCondition")StorageStockParam storageStockParam, @Param("operateId")Long operateId);

	Page<StorageStockResult> findGroupsStockPageBySpec(@Param("page")Page pageContext, @Param("paramCondition")StorageStockParam storageStockParam, @Param("operateId")Long operateId);


	void updateBySpec(@Param("paramCondition")StorageStockParam storageStockParam);


	StorageStockResult findKwShuBySpec(@Param("paramCondition")StorageStockParam param);


    StorageStockResult sumbyJhwsqzkk( @Param("stockParam") StorageStockParam stockParam);

	String getKCCountByGoodsNumber(@Param("detailedGoodscode") String detailedGoodscode,@Param("positionType") String positionType);

	String getDjhCountByGoodsNumber(@Param("detailedGoodscode") String detailedGoodscode, @Param("deptId") Long deptId);

	List<StorageStockResult> finByOnlyOnePositionNumber1(@Param("paramCondition") StorageStockParam storageOccupy);

	List<StorageStockResult> findListBySpec1(@Param("paramCondition") StorageStockParam paramCondition,@Param("operateId")Long operateId);

}
